//
// Created by Martin on 2021/9/29.
//

#ifndef DESIGNPATTERN_CPP_CASHCONTEXT_H
#define DESIGNPATTERN_CPP_CASHCONTEXT_H

#include "CashSuper.h"

/**
 * 通过构造方法传入具体的收费策略, 通过getResult功能根据不同收费策略获得不同的计算结果
 */
class CashContext {
public:
    explicit CashContext(CashSuper *cashSuper) : cashSuper(cashSuper) {}
    double getResult(double money);
private:
    CashSuper *cashSuper;
};


#endif //DESIGNPATTERN_CPP_CASHCONTEXT_H
